package dao.pojo;

import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * MemberInfo entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "member_info", catalog = "onlinemall")
public class MemberInfo implements java.io.Serializable {

	// Fields

	private Integer memberId;
	private String memberName;
	private String password;
	private String nickName;
	private Integer integration;
	private String email;
	private String tel;
	private String face;
	private Set<ShoppingCart> shoppingCarts = new HashSet<ShoppingCart>(0);
	private Set<ReceivingAddress> receivingAddresses = new HashSet<ReceivingAddress>(
			0);
	private Set<Comments> commentses = new HashSet<Comments>(0);

	// Constructors

	/** default constructor */
	public MemberInfo() {
	}

	/** minimal constructor */
	public MemberInfo(String memberName, String password, String nickName,
			Integer integration, String tel) {
		this.memberName = memberName;
		this.password = password;
		this.nickName = nickName;
		this.integration = integration;
		this.tel = tel;
	}

	/** full constructor */
	public MemberInfo(String memberName, String password, String nickName,
			Integer integration, String email, String tel, String face,
			Set<ShoppingCart> shoppingCarts,
			Set<ReceivingAddress> receivingAddresses, Set<Comments> commentses) {
		this.memberName = memberName;
		this.password = password;
		this.nickName = nickName;
		this.integration = integration;
		this.email = email;
		this.tel = tel;
		this.face = face;
		this.shoppingCarts = shoppingCarts;
		this.receivingAddresses = receivingAddresses;
		this.commentses = commentses;
	}

	// Property accessors
	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "member_id", unique = true, nullable = false)
	public Integer getMemberId() {
		return this.memberId;
	}

	public void setMemberId(Integer memberId) {
		this.memberId = memberId;
	}

	@Column(name = "member_name", nullable = false, length = 30)
	public String getMemberName() {
		return this.memberName;
	}

	public void setMemberName(String memberName) {
		this.memberName = memberName;
	}

	@Column(name = "password", nullable = false, length = 32)
	public String getPassword() {
		return this.password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	@Column(name = "nick_name", nullable = false, length = 30)
	public String getNickName() {
		return this.nickName;
	}

	public void setNickName(String nickName) {
		this.nickName = nickName;
	}

	@Column(name = "integration", nullable = false)
	public Integer getIntegration() {
		return this.integration;
	}

	public void setIntegration(Integer integration) {
		this.integration = integration;
	}

	@Column(name = "email", length = 50)
	public String getEmail() {
		return this.email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	@Column(name = "tel", nullable = false, length = 13)
	public String getTel() {
		return this.tel;
	}

	public void setTel(String tel) {
		this.tel = tel;
	}

	@Column(name = "face", length = 100)
	public String getFace() {
		return this.face;
	}

	public void setFace(String face) {
		this.face = face;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "memberInfo")
	public Set<ShoppingCart> getShoppingCarts() {
		return this.shoppingCarts;
	}

	public void setShoppingCarts(Set<ShoppingCart> shoppingCarts) {
		this.shoppingCarts = shoppingCarts;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "memberInfo")
	public Set<ReceivingAddress> getReceivingAddresses() {
		return this.receivingAddresses;
	}

	public void setReceivingAddresses(Set<ReceivingAddress> receivingAddresses) {
		this.receivingAddresses = receivingAddresses;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "memberInfo")
	public Set<Comments> getCommentses() {
		return this.commentses;
	}

	public void setCommentses(Set<Comments> commentses) {
		this.commentses = commentses;
	}

}